//
//  DDInterviewSendCell.m
//  DingDongZP
//
//  Created by 杨政涛 on 16/10/31.
//  Copyright © 2016年 51ledian.com. All rights reserved.
//

#import "DDInterviewSendCell.h"
#import "DDInterviewMessage.h"

@interface DDInterviewSendCell ()

@property (nonatomic, strong) UILabel *interviewType;

@property (nonatomic, strong) UILabel *interviewTime;

@end

@implementation DDInterviewSendCell
{
    UIView *inner;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        [self.messageTimeLabel removeFromSuperview];
        
        inner = [[UIView alloc] initWithFrame:CGRectMake(-50, 0, 250, 80)];
        inner.backgroundColor = [UIColor whiteColor];
        inner.layer.masksToBounds = YES;
        inner.layer.cornerRadius = 10.0;
        [self.messageContentView addSubview:inner];
        
        self.interviewType = [[UILabel alloc] initWithFrame:CGRectMake(15, 10, CGRectGetWidth(inner.bounds)-30, 30)];
        self.interviewType.font = [UIFont systemFontOfSize:16];
        self.interviewType.textColor = COLOR_FONT_BLACK;
        [inner addSubview:self.interviewType];
        
        self.interviewTime = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.interviewType.frame),CGRectGetMaxY(self.interviewType.frame), CGRectGetWidth(self.interviewType.frame), CGRectGetHeight(self.interviewType.frame))];
        self.interviewTime.font = [UIFont systemFontOfSize:16];
        self.interviewTime.textColor = COLOR_FONT_BLACK;
        [inner addSubview:self.interviewTime];
    }
    return self;
}

- (void)setDataModel:(RCMessageModel *)model
{
    [super setDataModel:model];

    DDInterviewMessage *message = (DDInterviewMessage *)model.content;
    
    NSString *interviewType;
    if (message.interviewType == 0) {
        
        interviewType = @"现场面试";
    }
    if (message.interviewType == 1) {
        
        interviewType = @"在线面试";
    }
    
    self.interviewType.text = [NSString stringWithFormat:@"面试类型 : %@",interviewType];
    self.interviewTime.text = [NSString stringWithFormat:@"面试时间 : %@",message.interviewTime];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
